package com.github.icloudpay.crm.core.rest;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.icloudpay.crm.core.biz.OrderInvoiceBiz;
import com.github.icloudpay.crm.core.entity.OrderInvoice;
import com.github.wxiaoqi.security.common.rest.BaseController;


/**
 * 开票
 * @author Administrator
 *
 */
@Controller
@RequestMapping("admin/orderInvoice")
public class OrderInvoiceController extends BaseController<OrderInvoiceBiz,OrderInvoice> {

	private static final Logger logger = LoggerFactory.getLogger(OrderInvoiceController.class);
	@Autowired
	OrderInvoiceBiz orderInvoiceBiz;
	
	
	/**
	 * 开票记录
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getInvoiceRecord", method = RequestMethod.POST)
	public Map<String, Object> getInvoiceRecord(Map<String, Object> map) {
		logger.info("查询开票记录，请求参数。。。{}"+map);
		Map<String, Object> resp = orderInvoiceBiz.queryInvoiceRecord(map);
		logger.info("查询开票记录，响应参数。。。{}"+resp);
		return resp;
	}
	
	/**
	 * 导出开票记录
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/exportInvoiceRecord", method = RequestMethod.POST)
	public Map<String, Object> exportInvoiceRecord(Map<String, Object> map) {
		logger.info("导出开票记录，请求参数。。。{}"+map);
		Map<String, Object> resp = orderInvoiceBiz.queryInvoiceRecord(map);
		
		
		
		
		logger.info("导出开票记录，响应参数。。。{}"+resp);
		return resp;
	}
	
	
	
	/**
	 * 开票
	 * @param map
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/updateInvoiceStatus", method = RequestMethod.POST)
	public Map<String, Object> updateInvoiceStatus(Map<String, Object> map) {
		logger.info("修改开票记录，请求参数。。。{}"+map);
		Map<String, Object> resp = orderInvoiceBiz.queryInvoiceRecord(map);
		logger.info("修改开票记录，响应参数。。。{}"+resp);
		return resp;
	}
	
	
	
	
	
	
}